import {post,get} from './request'
import {AxiosResponse} from 'axios'
interface Iadmin{
    (admin_name:string, pwd:string):Promise<AxiosResponse<any>>
}
export const login:Iadmin=(admin_name:string, pwd:string):Promise<AxiosResponse<any>> =>{


  return  post("/admin/login",{admin_name,pwd});
  

}

export const getList=(params:any):Promise<AxiosResponse<any>>=>{

    return  get("visituser/list",params);
}


export const getdepartment=():Promise<AxiosResponse<any>>=>{

  return  get("department/list");
}


export const visitoradd=(person:any):Promise<AxiosResponse<any>>=>{
  return  post("visituser/add",person);
}

export const authenlist=(person:any):Promise<AxiosResponse<any>>=>{
  return  get("reviewer/list",person);
}


export const addauthen=(person:any):Promise<AxiosResponse<any>>=>{
  return  post("reviewer/add",person);
}

export const delauthen=(id:any):Promise<AxiosResponse<any>>=>{
  return  get("reviewer/del",id);
}
export const upisuses=(person:any):Promise<AxiosResponse<any>>=>{
  return  post("reviewer/changestatus",person);
}

export const upauthen=(person:any):Promise<AxiosResponse<any>>=>{
  return  post("reviewer/edit",person);
}


export const newlist=(person:any):Promise<AxiosResponse<any>>=>{
  return  get("news/list",person);
}


export const addnews=(person:any):Promise<AxiosResponse<any>>=>{
  return  post("news/add",person);
}


export const delnews=(person:any):Promise<AxiosResponse<any>>=>{
  return  get("news/del",person);
}


export const onenews=(person:any):Promise<AxiosResponse<any>>=>{
  return  get("news/show",person);
}

export const upnews=(person:any):Promise<AxiosResponse<any>>=>{
  return  post("news/edit",person);
}
